
import React, { useState } from "react";

import UiCheckBox from "../checkbox/index";
import "./index.less";

const UiTree = (props) => {
    const { params, checkedChange } = props;

    return (
        <div style={{ marginLeft: `${params.left}px` }} className="ui-tree-item">
            {params.children ? "" : <span className="ui-tree-space"></span>}
            <span onClick={checkedChange.bind(this)}>
                <UiCheckBox checked={params.checked} />
            </span>
            <div className="ui-tree-label">{params.label}</div>
        </div>
    );
};
export default UiTree;
